"""
4、携带cookies发送请求，zrlog系统文章发布接口
"""
import requests

# zrlog系统文章发布接口
url = "http://127.0.0.1:8080/api/admin/article/update"
# 请求数据
data = {
    "canComment": "false",
    "content": "<p>再写一篇文章看看</p>\n",
    "logId": 3,
    "markdown": "再写一篇文章看看",
    "privacy": "false",
    "recommended": "false",
    "rubbish": "true",
    "title": "文章3",
    "typeId": 1,
    "version": 0
}
# 抓包获得的cookie，注意cookie有时效性
cookies = {
    "admin-token": "1#42464944694933747554482F574C58534E4773352B304E6C6266434964323142762F57764D6F73396E51724A62704366545641304A6A4457714938515551493733444A2B6A742F6639654E37746E304D50427A6A5938776F534B76766C523148352B4E64724F796C6E4D3245777033416C6C4F6B456950775772544A6F6739515A2B4576735235557473594B353378754D48333430413D3D"
}
# 发送post请求
response = requests.post(url=url, json=data, cookies=cookies)
# 获取响应
print(response.text)
# 以JSON格式返回服务端响应的内容
print(response.json())

